//
//  AdapterTool.m
//  WZMallApp
//
//  Created by rimi on 16/9/2.
//  Copyright © 2016年 Senntten. All rights reserved.
//

#import "AdapterTool.h"
#import "MacroDefine.h"

@implementation AdapterTool

+ (CGRect)getAdapterRectWithRect:(CGRect)rect isHeight:(BOOL)isHeight{
    CGRect newRect = CGRectZero;
    newRect.origin = [self getNewPointWithPoint:rect.origin];
    newRect.size = [self getNewSizeWithSize:rect.size isHeight:isHeight];
    return newRect;
}

+ (CGPoint)getNewPointWithPoint:(CGPoint)point{
    CGPoint newPoint = CGPointZero;
    newPoint.x = point.x * ADAPTER_WIDTH;
    newPoint.y = point.y * ADAPTER_HEIGHT;
    return newPoint;
}

+ (CGSize)getNewSizeWithSize:(CGSize)size isHeight:(BOOL)isHeight{
    CGSize newSize = CGSizeZero;
    newSize.width = size.width * ADAPTER_WIDTH;
    if (isHeight) {
        newSize.height = size.height * ADAPTER_HEIGHT;
    }else{
        newSize.height = size.height * ADAPTER_WIDTH;
    }
    return newSize;
}

@end
